package com.olt.controller.PowerController;


import com.olt.domain.user.OltPower;
import com.olt.result.ErrorEnum;
import com.olt.result.Result;
import com.olt.result.TreeResult;
import com.olt.server.power.PowerSevere;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class PowerController {
    @Autowired
    PowerSevere powerSevere;

    @GetMapping("api/power/getPowers")
    public Result<TreeResult<OltPower>> getPowers(){
        List<TreeResult<OltPower>> list=powerSevere.getOltPowers();
        Result<TreeResult<OltPower>> result=new Result<>();
        result.list=list;
        result.setError(ErrorEnum.Success_Http);
        return  result;
    }


}
